<div class="hbox hbox-auto-xs hbox-auto-sm" ng-controller="functionCtrl">
    <div class="col w-lg bg-white dk bg-auto b-r" id="aside">
        <div class="wrapper b-b">
            <div>
                <button class="btn btn-sm btn-success pull-right" ng-click="createFunction()" ui-toggle-class="timeline-center" target=".timeline">添加权限</button>
                <h3 class="m-n font-thin">权限管理</h3>
            </div>
        </div>
        <div class="wrapper">
            <div class="tab-container ng-isolate-scope m-n">
                <ul class="nav nav-tabs h5">
                    <li class="ng-isolate-scope" ng-class="{true:'active',false:''}[platform==0]" ng-click="changePlatform(0)">
                        <a href="">
                                商户
                        </a>
                    </li>
                    <li class="ng-isolate-scope" ng-class="{true:'active',false:''}[platform==1]" ng-click="changePlatform(1)">
                        <a href="">
                                城市代理
                        </a>
                    </li>
                    <li class="ng-isolate-scope" ng-class="{true:'active',false:''}[platform==2]" ng-click="changePlatform(2)">
                        <a href="">
                                总部
                        </a>
                    </li>
                </ul>
            </div>
            <div class="b-l b-r b-b padder padder-v">
                <div ng-if="!findByPlatformState">
                    <abn-tree
                            tree-data="treeList"
                            tree-control="tree"
                            on-select="treeOnSelect(branch)"
                            expand-level="2"
                            initial-selection="Granny Smith"
                            icon-leaf="fa fa-fw"
                            icon-expand="fa fa-fw fa-plus"
                            icon-collapse="fa fa-fw  fa-minus"
                            class="h5"
                            >
                    </abn-tree>
                </div>
                <circle-loading ng-if="findByPlatformState"></circle-loading>
            </div>
        </div>
    </div>
    <div class="wrapper">
        <div class="panel-default panel" ng-if="selected">
            <div class="panel-heading">
                <strong>功能</strong>
            </div>
            <div class="panel-body padder-v panel-default bg-white">
                <div>
                    <form class="form-horizontal form-validation" method="post" ng-submit="saveFunction()">
                        <input ng-model="function.id" type="hidden">
                        <input ng-model="function.parentId" type="hidden">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">Code</label>
                            <div class="col-sm-5">
                                <input ng-model="function.code" type="text" class="form-control" disabled>
                            </div>
                        </div>
                        <div class="line line-dashed b-b line-lg"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">Name</label>
                            <div class="col-sm-5">
                                <input ng-model="function.name" type="text" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">Icon</label>
                            <div class="col-sm-5">
                                <input ng-model="function.icon" type="text" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">URL</label>
                            <div class="col-sm-5">
                                <input ng-model="function.url" type="text" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">Sort</label>
                            <div class="col-sm-5">
                                <input ui-jq="TouchSpin" type="text" value="1" class="form-control"
                                       data-min='1'data-step="1" ng-model="function.sort" ng-disabled="disabled">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">Level</label>
                            <div class="col-sm-5">
                                <input ng-model="function.level" type="text" class="form-control" disabled>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">Child Count</label>
                            <div class="col-sm-5">
                                <input ng-model="function.childCount" type="text" class="form-control" disabled>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">Path</label>
                            <div class="col-sm-5">
                                <input ng-model="function.path" type="text" class="form-control" disabled>
                            </div>
                        </div>

                        <footer class="panel-footer text-right bg-light lter">
                            <button type="button" ng-click="delete()" class="btn btn-danger" ng-if="function.id!=''">删除</button>
                            <button type="submit" class="btn btn-success">保存</button>
                        </footer>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

